package com.mai4j.maiadmin.validation.constraints;


import com.mai4j.maiadmin.validation.constraintvalidators.LanguageTagValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Created by 席有芳 on 2021/12/3.
 * 是否包含在可选值中
 *
 * @author 席有芳
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = LanguageTagValidator.class)
@Repeatable(LanguageTag.List.class)
@Documented
public @interface LanguageTag {

    String message() default "{com.mai4j.validator.constraints.LanguageTag.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
    @Retention(RUNTIME)
    @Documented
    @interface List {
        LanguageTag[] value();
    }
}
